package com.yanqu.road.server.cmd.unionwar;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.unionwar.CrossUnionWarProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.unionwar.CrossUnionWarMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_UNION_WAR_MATCH_INFO_SYNC_BACK, desc = "商会对阵信息下发-结果回传")
public class CrossUnionWarMatchInfoSyncBackCmd extends CrossUnionCommand {

    private CrossUnionWarProto.CroUnionWarMatchInfoBackMsg backMsg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        backMsg = CrossUnionWarProto.CroUnionWarMatchInfoBackMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossUnionWarMgr.updateMatchInfoSendResult(serverId, backMsg.getActivityId(), backMsg.getPhase(), backMsg.getSession(), backMsg.getUnionUidList(), backMsg.getGroupId());
    }

    @Override
    public void sendData() {

    }
}
